﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Rmlife.Common;

namespace Rmlife.Config
{
    public class GeneralConfigInfo : IConfigInfo
    {
        private int m_deletingexpireduserfrequency = 5;//删除过期用户频率(单位:时间)

        public GeneralConfigInfo()
        {
            // 初始值
            Onlinetimeout = 30;
            Expires = 0;
            Passwordkey = CompanyProperties.ASSEMBLY_AUTHKEY;
            CompanyOnlinetimeout = 720;
            FullScreen = true;
            GoogleAPIKey = string.Empty;
            SearchPinYin = true;
            LoginMethod = 1;
            AllowSafeCode = 1;
        }


        /// <summary>
        /// 用户密码Key
        /// </summary>
        public string Passwordkey { get; set; }

        /// <summary>
        /// 多久无动作视为离线
        /// </summary>
        public int Onlinetimeout { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public int Expires { get; set; }

        /// <summary>
        /// 删除过期用户频率
        /// </summary>
        public int Deletingexpireduserfrequency
        {
            get
            {
                if (m_deletingexpireduserfrequency < 1)
                    m_deletingexpireduserfrequency = 5;
                return m_deletingexpireduserfrequency;
            }
            set { m_deletingexpireduserfrequency = value; }
        }

        /// <summary>
        /// 单位多久无动作视为离线
        /// </summary>
        public int CompanyOnlinetimeout { get; set; }

        /// <summary>
        /// GoogleAPIKey
        /// </summary>
        public string GoogleAPIKey { get; set; }
        /// <summary>
        /// 是否在全屏状态下使用
        /// </summary>
        public bool FullScreen { get; set; }

        /// <summary>
        /// 是否开启拼音首字母模糊查询
        /// </summary>
        public bool SearchPinYin { get; set; }

        /// <summary>
        /// 默认的登录方式
        /// </summary>
        public int LoginMethod { get; set; }
        /// <summary>
        /// 是否启用神盾登录
        /// </summary>
        public int AllowSafeCode { get; set; }
    }
}
